<template>
  <view class="cu-bar bg-white search" :class="searchFormFixClassNames">
    <slot name="mainForm"></slot>
    <view class="action" @tap="isShow = true">更多</view>
  </view>
  <GdDialog :modal-style="'Right'" v-model:isShow="isShow">
    <template #content>
      <slot name="modalForm"></slot>
    </template>
  </GdDialog>
</template>
<script>
export default {
  name: "GdSearchForm",
};
</script>
<script setup>
import { ref, computed } from "vue";
import GdDialog from "@gd-accbuild-ui/gd-ui/mobile/gd-dialog/gd-dialog.vue";
const props = defineProps({
  hasTopFixedSlot: {
    type: Boolean,
    default: false,
  },
});
const searchFormFixClassNames = computed(() => {
  return !props.hasTopFixedSlot ? ["fixed","fixed-top"] : [];
});
const isShow = ref(false);
</script>
<style lang="scss" scoped>
.cu-bar.fixed.fixed-top {
  top: var(--window-top);
}
</style>
